import http from "@/api";

/**
 * @name 角色管理模块
 */
//获取所有角色
export const getAllRoleList = (params = {}) => {
  return http.get(`role/all`, params, { noLoading: true });
};
// 新增角色
export const addRole = (params = {}) => {
  return http.post(`/role/save`, params, { noLoading: true });
};
// 编辑角色
export const editRole = (params: { roleId: string }) => {
  return http.post(`/role/save`, params, { noLoading: true });
};

// 获取角色权限树
export const getRoleTree = (params = {}) => {
  return http.get(`/rights/tree`, params);
};

// 获取角色权限
export const getRoleRights = (params: { roleid: string }) => {
  return http.get(`/role/rights`, params);
};

// 修改角色权限
export const savetRoleRights = (params: { id: string; clause: string }) => {
  return http.post(`/role/rights/save`, params, { noLoading: true });
};
